project(zucmotmod)
include_directories(./)
link_directories(${CMAKE_SOURCE_DIR}/${HOST_ARCH}/lib)
add_library(zucmot SHARED
motion.cc
command.cc
rtcmds.cc
control.cc
jacobin.cc
zucmotutil.cc
stashf.cc
dbuf.c
timemonitor.c
# scb_can.c 
can_dynamics.cc
modbuscrc.c
semintf.c 
cubic.cc
adapt_notch.cc
IOmapping.cc
motionItf.cc
torque_control_queue.cc
safezone.cc
)
target_link_libraries(zucmot
PUBLIC hwdrv
PUBLIC rtbus
PUBLIC rtdev
PUBLIC kine
PUBLIC zuctp
PUBLIC jkzuc
PUBLIC controlcan
PUBLIC posemath
PUBLIC JKLPSOLVE
PUBLIC axis 
PRIVATE JAKADYN
PRIVATE axisgroup
PRIVATE safety
PRIVATE dynamic
PRIVATE motion_cmd
PRIVATE axis_setting_cmd
PRIVATE m
PRIVATE pthread
PRIVATE rt
PRIVATE ${ZLOG_CLI_LIBS}
)
install(TARGETS zucmot DESTINATION bin)

aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/test mottestsrcs)
ADD_TEST(mottest
SOURCES ${CMAKE_CURRENT_LIST_DIR}/rtcmds.cc ${mottestsrcs} ${JKTEST_MAIN}
LIBRARIES axis axisgroup
)

add_subdirectory(motion_cmd)
add_subdirectory(axis_setting_cmd)
